<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="../../css/weui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../css/jquery-weui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../css/index.css" />
    <link rel="stylesheet" type="text/css" href="../../css/order.css" />
    <title>运输车信息</title>
    <script src="../../js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/baseConfig.js" type="text/javascript" charset="utf-8"></script>
    <script src=" http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</head>

<body>
    <!--<div id="header">
			<div class="header-title" style="position: fixed;top: 0;">
				<img src="../../img/left.png" class="left" />
				<span>运输车信息</span>
			</div>
		</div>-->
    <div class="transport-warp" style="margin-top: 0;">
        <div class="identity-type">
            <span>基本信息</span>
        </div>
        <div class="essen_list  transport_after transport_after2">
            <!--<p>
					<span>车牌号</span>
					<b>津A12345</b>
				</p>
				<p>
					<span>司机姓名</span>
					<b>张山山</b>
				</p>
				<p>
					<span>司机电话</span>
					<b>13277896957</b>
				</p>
				<p>
					<span>司机身份证</span>
					<b>432010*******1315</b>
				</p>				-->
        </div>
        <div class="essen_list transport_after transport_after1" style="border: 0;">
            <!--<p>
					<span>装车时间</span>
					<b>2017/06/28</b>
				</p>
				<p>
					<span>预计到达时间</span>
					<b>16:45:25</b>
				</p>
				<p>
					<span>装车物料总量</span>
					<b>30.12<em>吨</em></b>
				</p>				-->
        </div>
        <!--物料列表-->
        <div class="identity-type">
            <span>物料列表</span>
        </div>
        <div class="material-list">
            <ul class="material_list transport-list">
                <!--<li>
						<p>
							<span>冰箱压缩机</span>
							<img src="../../img/right.png"/>
						</p>
						<p>
							<span>物料重量</span>
							<b>556.34<em>吨</em></b>							
						</p>
						<p>
							<span>订单编号</span>
							<b>HSGFHGKJH2017564654</b>
						</p>
						
					</li>-->
            </ul>
            <ol class="transport_photo_list">
                <!--<li>
						<img src="../../img/squarePhoto.png"/>
						<span>车牌号</span>
					</li>
					<li>
						<img src="../../img/squarePhoto.png"/>
						<span>司机照片1</span>
					</li>
					<li>
						<img src="../../img/squarePhoto.png"/>
						<span>司机照片2</span>
					</li>
					<li>
						<img src="../../img/squarePhoto.png"/>
						<span>身份证正面</span>
					</li>
					<li>
						<img src="../../img/squarePhoto.png"/>
						<span>榜单</span>
					</li>-->
            </ol>
        </div>
    </div>
</body>
<script type="text/javascript">
    $(document).ready(function() {
        baseConfig.historyBack()
        $.showLoading("加载中...");
        $.ajax({
            type: "get",
            url: baseConfig.localHttp + "weChatApi/fgclient/getTransInfo",
            async: false,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            data: {
                carNo: baseConfig.GetQueryString("carNo"),
                orderNo: baseConfig.GetQueryString("orderNo")
            },
            success: function(data) {
                console.log(data)
                $.hideLoading();
                if (data.code == 100) {
                    var transferInfoVo = data.content.transferInfoVo;
                    var goodsVoList = data.content.goodsVoList;
                    var urlVo = data.content.urlVo;
                    var $li = ""
                    var $imgli = ""
                    $(".transport_after2").html(
                        "<p><span>车牌号</span><b>" + transferInfoVo.carNo + "</b></p><p><span>司机姓名</span><b>" + transferInfoVo.driver + "</b></p><p><span>司机电话</span><b>" + transferInfoVo.phone + "</b></p><p><span>司机身份证</span><b>" + transferInfoVo.idCard + "</b></p>"
                    )
                    $(".transport_after1").html(
                        "<p><span>装车时间</span><b>" + transferInfoVo.uploadTime.slice(0, 19) + "</b></p><p><span>预计到达时间</span><b>" + transferInfoVo.planTime.slice(0, 19) + "</b></p><p><span>装车物料总量</span><b>" + transferInfoVo.weight + "<em>吨</em></b></p>"
                    )
                    for (var i = 0; i < goodsVoList.length; i++) {
                        $li += "<li><p><span>" + goodsVoList[i].goodsName + "</span></p><p><span>物料重量</span><b>" + goodsVoList[i].goodsWeight + "<em>吨</em></b></p><p><span>订单编号</span><b>" + goodsVoList[i].orderNo + "</b></p></li>"
                    }
                    $(".transport-list").append($li)
                    if (!urlVo) {

                    } else {
                        if (!urlVo.carNoPic) {
                            $imgli += "<li><img src='../../img/squarePhoto.png'/><span>车牌号</span></li>"
                        } else {
                            $imgli += "<li><img src='" + baseConfig.imglocalHttp + urlVo.carNoPic + "'/><span>车牌号</span></li>"
                        }
                        if (!urlVo.driverPic1) {
                            $imgli += "<li><img src='../../img/squarePhoto.png'/><span>司机照片</span></li>"
                        } else {
                            $imgli += "<li><img src='" + baseConfig.imglocalHttp + urlVo.driverPic1 + "'/><span>司机照片</span></li>"
                        }
                        if (!urlVo.driverPic2) {
                            $imgli += "<li><img src='../../img/squarePhoto.png'/><span>司机照片2</span></li>"
                        } else {
                            $imgli += "<li><img src='" + baseConfig.imglocalHttp + urlVo.driverPic2 + "'/><span>司机照片2</span></li>"
                        }
                        if (!urlVo.idCardPic) {
                            $imgli += "<li><img src='../../img/squarePhoto.png'/><span>身份证正面</span></li>"
                        } else {
                            $imgli += "<li><img src='" + baseConfig.imglocalHttp + urlVo.idCardPic + "'/><span>身份证正面</span></li>"
                        }
                        if (!urlVo.weightPic) {
                            $imgli += "<li><img src='../../img/squarePhoto.png'/><span>磅单</span></li>"
                        } else {
                            for (var j = 0; j < urlVo.weightPic.length; j++) {
                                $imgli += "<li><img src='" + baseConfig.imglocalHttp + urlVo.weightPic[j] + "'/><span>磅单</span></li>"
                            }

                        }
                    }
                    $(".transport_photo_list").append($imgli)
                    var imgsurl = [];
                    var nowurl = '';
                    var imgObj = $(".transport_photo_list li img");
                    for (var i = 0; i < imgObj.length; i++) {
                        imgsurl[i] = imgObj[i].src;
                        imgObj[i].onclick = function() {
                            nowurl = this.src;
                            wx.previewImage({
                                current: nowurl,
                                urls: imgsurl
                            });
                        }
                    }
                } else {
                    $.toptip(data.content, 1200, 'error');
                }
            },
            error: function() {
                $.hideLoading();
            }
        })
    })
</script>

</html>